import { DescItem } from '/@/components/Description/src/types';
import { TableImg } from '/@/components/Table';
export const schema: DescItem[] = [
  {
    field: 'title',
    label: '标题',
  },
  {
    field: 'area',
    label: '区域位置',
    render: (curVal, data) => {
      console.log(data, '区域');
      const content = `${data.province} / ${data.area}`;
      if (data.province) {
        return content;
      }
    },
  },
  {
    field: 'address',
    label: '详细地址',
  },

  {
    field: 'prices',
    label: '价格',
    render: (curVal, data) => {
      return data.symbol?data.symbol+data.prices:data.prices
    },
  },
  {
    field: 'goodsType',
    label: '类型',
  },
  {
    field: 'remark',
    label: '详情',
  },
  // {
  //   field: 'wechat',
  //   label: '微信',
  // },
  // {
  //   field: 'phone',
  //   label: '电话',
  // },
  // {
  //   field: 'email',
  //   label: '邮箱',
  // },
  {
    field: 'contactType',
    label: '联系方式',
    render: (curVal, data) => {
      console.log(data, '联系方式');
      let content;
      if (data.contactType == 0) {
        content = `微信 ： ${data.wechat}`;
      } else if (data.contactType == 1) {
        content = `电话 ： ${data.phone}`;
      } else if (data.contactType == 2) {
        content = `邮箱 ： ${data.email}`;
      }
      return content;
    },
  },
  {
    field: 'imgUrlsList',
    label: '照片',
    render: (curVal, data) => {
      console.log(data, '图片');
      return (
        <div style=" overflow: hidden">
          <TableImg size={250} imgList={data.imgUrlsList} />
        </div>
      );
    },
  },
  {
    field: 'videoUrl',
    label: '视频',
    render: (curVal, data) => {
      const list = [data.videoUrl];
      console.log(list, 'list');
      // return <TableImg size={120} simpleShow={true} imgList={list} />;
      if (!list[0] == '') {
        return <video src={data.videoUrl} controls="controls" width="200"></video>;
      }
    },
  },
];
